package projects.jnurse.ioc.core;

/**
 * Created by Adil Naji.
 * User: XP-170708
 * Date: 25 nov. 2008
 * Time: 15:39:06
 */
public class Configurator {

    DependencyStore store = DependencyStore.instance;
    private String currentAlias;
    static Configurator instance;
    

    public static Configurator make(String alias) {
        instance = new Configurator();
        instance.currentAlias = alias;
        return instance;
    }

    public void anAliasFor(Class clazz) {
        Object ref = null;
        try { ref = clazz.newInstance(); }
        catch (Exception e) { e.printStackTrace(); }
        store.addDependency(currentAlias, ref);
    }
}
